2025-03-25 21:39:00,606 - INFO - Num classes: 4
2025-03-25 21:42:03,720 - INFO - Class weights: tensor([0.3450, 9.9098, 2.4496, 1.6890], device='cuda:0')
2025-03-25 22:07:58,038 - INFO - Num classes: 4
2025-03-25 22:09:10,003 - INFO - Class weights: tensor([0.3450, 9.9098, 2.4496, 1.6890], device='cuda:0')
2025-03-25 22:09:12,180 - INFO - Model architecture:
CombinedModelCNN(
  (unet): Unet(
    (conv1): Sequential(
      (0): Conv2d(1024, 8, kernel_size=(5, 5), stride=(1, 1), padding=(5, 5))
      (1): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(8, 8, kernel_size=(5, 5), stride=(1, 1), padding=(5, 5))
      (4): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    )
    (conv2): Sequential(
      (0): Conv2d(8, 16, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2))
      (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(16, 16, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2))
      (4): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    )
    (conv3): Sequential(
      (0): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    )
    (upconv3): Sequential(
      (0): Conv2d(32, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(16, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): ConvTranspose2d(16, 16, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
    )
    (upconv2): Sequential(
      (0): Conv2d(32, 8, kernel_size=(4, 4), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(8, 8, kernel_size=(4, 4), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): ConvTranspose2d(8, 8, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
    )
    (upconv1): Sequential(
      (0): Conv2d(16, 4, kernel_size=(6, 6), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(4, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(4, 4, kernel_size=(6, 6), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(4, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): ConvTranspose2d(4, 4, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
    )
  )
  (san): ImprovedHyperspectralLogisticRegressionModel(
    (spectral_attention): SpectralAttention(
      (fc): Sequential(
        (0): Linear(in_features=1024, out_features=64, bias=True)
        (1): ReLU(inplace=True)
        (2): Linear(in_features=64, out_features=1024, bias=True)
        (3): Sigmoid()
      )
    )
    (linear): Sequential(
      (0): LinearBlock(
        (block): Sequential(
          (0): Linear(in_features=1024, out_features=20, bias=True)
          (1): BatchNorm1d(20, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (2): LeakyReLU(negative_slope=0.1)
          (3): Dropout(p=0.0, inplace=False)
        )
      )
      (1): LinearBlock(
        (block): Sequential(
          (0): Linear(in_features=20, out_features=20, bias=True)
          (1): BatchNorm1d(20, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (2): LeakyReLU(negative_slope=0.1)
          (3): Dropout(p=0.0, inplace=False)
        )
      )
      (2): Linear(in_features=20, out_features=4, bias=True)
    )
    (logistic): Linear(in_features=4, out_features=4, bias=True)
  )
  (cnn): Sequential(
    (0): Conv2d(8, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (1): ReLU(inplace=True)
    (2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (3): Dropout2d(p=0.2, inplace=False)
    (4): Conv2d(64, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (5): ReLU(inplace=True)
    (6): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (7): Dropout2d(p=0.2, inplace=False)
    (8): Conv2d(32, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (9): ReLU(inplace=True)
    (10): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (11): Dropout2d(p=0.2, inplace=False)
    (12): Conv2d(16, 4, kernel_size=(1, 1), stride=(1, 1))
  )
)
2025-03-25 22:09:12,181 - INFO - Using cuda device
2025-03-25 22:12:04,235 - INFO - Epoch: 0/100. Training time: 124.271
2025-03-25 22:12:04,235 - INFO - Training Metrics...
2025-03-25 22:12:04,235 - INFO - {'loss': 1.3755838700703211, 'f1': 27.282073543280855, 'acc': 35.30260243632337, 'precision': 33.340797633060056, 'recall': 34.46653408396172, 'balanced acc': 34.46653408396172}
2025-03-25 22:12:04,235 - INFO - Validation Metrics... Inference time: 47.781
2025-03-25 22:12:04,235 - INFO - {'loss': 1.3007066249847412, 'f1': 53.35170850304074, 'acc': 63.94097956307259, 'precision': 54.55545357490674, 'recall': 60.121044093047836, 'balanced acc': 60.121044093047836}
2025-03-25 22:12:04,235 - INFO - ==================================================
2025-03-25 22:21:39,501 - INFO - Epoch: 5/100. Training time: 68.915
2025-03-25 22:21:39,630 - INFO - Training Metrics...
2025-03-25 22:21:39,633 - INFO - {'loss': 0.674552823816027, 'f1': 58.860137853754146, 'acc': 65.24884643779994, 'precision': 58.1757347193037, 'recall': 81.1647047472909, 'balanced acc': 81.1647047472909}
2025-03-25 22:21:39,633 - INFO - Validation Metrics... Inference time: 25.069
2025-03-25 22:21:39,633 - INFO - {'loss': 0.9476660490036011, 'f1': 64.30027383705637, 'acc': 64.59108527131782, 'precision': 64.58024467569012, 'recall': 83.61135435729197, 'balanced acc': 83.61135435729197}
2025-03-25 22:21:39,634 - INFO - ==================================================
2025-03-25 22:30:58,278 - INFO - Epoch: 10/100. Training time: 76.342
2025-03-25 22:30:58,340 - INFO - Training Metrics...
2025-03-25 22:30:58,341 - INFO - {'loss': 0.6072996996697926, 'f1': 63.76227372388015, 'acc': 72.65448504983388, 'precision': 61.220347983356596, 'recall': 82.81019117076592, 'balanced acc': 82.81019117076592}
2025-03-25 22:30:58,341 - INFO - Validation Metrics... Inference time: 28.763
2025-03-25 22:30:58,341 - INFO - {'loss': 0.8099598288536072, 'f1': 67.20949261702012, 'acc': 70.12455954897816, 'precision': 65.43681230960951, 'recall': 85.10236264575659, 'balanced acc': 85.10236264575659}
2025-03-25 22:30:58,341 - INFO - ==================================================
2025-03-25 22:39:37,976 - INFO - Epoch: 15/100. Training time: 72.229
2025-03-25 22:39:37,983 - INFO - Training Metrics...
2025-03-25 22:39:37,984 - INFO - {'loss': 0.5801127212388175, 'f1': 65.7300554573341, 'acc': 75.09302325581395, 'precision': 63.365084293822726, 'recall': 83.86625137068728, 'balanced acc': 83.86625137068728}
2025-03-25 22:39:37,984 - INFO - Validation Metrics... Inference time: 28.434
2025-03-25 22:39:37,984 - INFO - {'loss': 0.7951975464820862, 'f1': 68.59897723967747, 'acc': 71.26057082452432, 'precision': 67.2579419354658, 'recall': 85.5197197254638, 'balanced acc': 85.5197197254638}
2025-03-25 22:39:37,984 - INFO - ==================================================
2025-03-25 22:48:44,966 - INFO - Epoch: 20/100. Training time: 77.023
2025-03-25 22:48:44,987 - INFO - Training Metrics...
2025-03-25 22:48:44,987 - INFO - {'loss': 0.5785549481709799, 'f1': 65.97706937571344, 'acc': 77.47632890365449, 'precision': 63.08350771684205, 'recall': 85.25534631467076, 'balanced acc': 85.25534631467076}
2025-03-25 22:48:44,987 - INFO - Validation Metrics... Inference time: 25.805
2025-03-25 22:48:44,987 - INFO - {'loss': 0.7596355676651001, 'f1': 70.39029605474579, 'acc': 73.80479210711769, 'precision': 68.69690840448727, 'recall': 86.14204928399528, 'balanced acc': 86.14204928399528}
2025-03-25 22:48:44,987 - INFO - ==================================================
2025-03-25 22:57:27,580 - INFO - Epoch: 25/100. Training time: 91.990
2025-03-25 22:57:27,634 - INFO - Training Metrics...
2025-03-25 22:57:27,634 - INFO - {'loss': 0.49969315386953805, 'f1': 68.40077409426344, 'acc': 80.40942229605021, 'precision': 64.89901301353888, 'recall': 86.15035203322935, 'balanced acc': 86.15035203322935}
2025-03-25 22:57:27,634 - INFO - Validation Metrics... Inference time: 8.255
2025-03-25 22:57:27,634 - INFO - {'loss': 0.6847667098045349, 'f1': 73.94997500052935, 'acc': 79.93569415081043, 'precision': 70.54522591269793, 'recall': 87.06285604858905, 'balanced acc': 87.06285604858905}
2025-03-25 22:57:27,634 - INFO - ==================================================
2025-03-25 23:07:08,046 - INFO - Epoch: 30/100. Training time: 74.579
2025-03-25 23:07:08,124 - INFO - Training Metrics...
2025-03-25 23:07:08,125 - INFO - {'loss': 0.5137310567356291, 'f1': 67.09449787303502, 'acc': 77.91094499815429, 'precision': 64.01351356436066, 'recall': 85.91383533809976, 'balanced acc': 85.91383533809976}
2025-03-25 23:07:08,125 - INFO - Validation Metrics... Inference time: 46.426
2025-03-25 23:07:08,125 - INFO - {'loss': 0.7569127082824707, 'f1': 71.9291786818422, 'acc': 76.2316772374912, 'precision': 69.74620965101123, 'recall': 86.63268230125442, 'balanced acc': 86.63268230125442}
2025-03-25 23:07:08,125 - INFO - ==================================================
2025-03-25 23:16:31,398 - INFO - Epoch: 35/100. Training time: 97.081
2025-03-25 23:16:31,471 - INFO - Training Metrics...
2025-03-25 23:16:31,472 - INFO - {'loss': 0.4799000393776667, 'f1': 69.85647721137215, 'acc': 80.71677740863788, 'precision': 66.18001975317364, 'recall': 87.5828925265081, 'balanced acc': 87.5828925265081}
2025-03-25 23:16:31,472 - INFO - Validation Metrics... Inference time: 44.229
2025-03-25 23:16:31,472 - INFO - {'loss': 0.7005830407142639, 'f1': 73.64055970147618, 'acc': 79.0667723749119, 'precision': 70.77300288981326, 'recall': 87.09689256772907, 'balanced acc': 87.09689256772907}
2025-03-25 23:16:31,472 - INFO - ==================================================
2025-03-25 23:25:59,736 - INFO - Epoch: 40/100. Training time: 94.752
2025-03-25 23:25:59,769 - INFO - Training Metrics...
2025-03-25 23:25:59,769 - INFO - {'loss': 0.4724295934041341, 'f1': 70.09993431714507, 'acc': 81.90891472868218, 'precision': 66.77543763361037, 'recall': 88.31983154939253, 'balanced acc': 88.31983154939253}
2025-03-25 23:25:59,769 - INFO - Validation Metrics... Inference time: 8.900
2025-03-25 23:25:59,770 - INFO - {'loss': 0.685820996761322, 'f1': 74.25791166661445, 'acc': 79.86663143058492, 'precision': 71.39565056570626, 'recall': 87.26559668448316, 'balanced acc': 87.26559668448316}
2025-03-25 23:25:59,770 - INFO - ==================================================
2025-03-25 23:36:11,906 - INFO - Epoch: 45/100. Training time: 81.638
2025-03-25 23:36:11,959 - INFO - Training Metrics...
2025-03-25 23:36:11,959 - INFO - {'loss': 0.48149584446634563, 'f1': 70.65640608813023, 'acc': 82.72457548911038, 'precision': 66.44620367865343, 'recall': 87.28502990482848, 'balanced acc': 87.28502990482848}
2025-03-25 23:36:11,960 - INFO - Validation Metrics... Inference time: 17.528
2025-03-25 23:36:11,960 - INFO - {'loss': 0.6671983599662781, 'f1': 74.59656934509496, 'acc': 79.97040169133193, 'precision': 72.14180494814612, 'recall': 87.33838303431213, 'balanced acc': 87.33838303431213}
2025-03-25 23:36:11,960 - INFO - ==================================================
2025-03-25 23:45:34,309 - INFO - Epoch: 50/100. Training time: 86.863
2025-03-25 23:45:34,321 - INFO - Training Metrics...
2025-03-25 23:45:34,321 - INFO - {'loss': 0.4656998685428074, 'f1': 69.73995923239727, 'acc': 81.35908084163897, 'precision': 67.01741706154957, 'recall': 84.55083222854023, 'balanced acc': 84.55083222854023}
2025-03-25 23:45:34,321 - INFO - Validation Metrics... Inference time: 17.365
2025-03-25 23:45:34,321 - INFO - {'loss': 0.6709020733833313, 'f1': 74.73874401522735, 'acc': 80.49207188160676, 'precision': 71.78255037817355, 'recall': 87.42382852907672, 'balanced acc': 87.42382852907672}
2025-03-25 23:45:34,321 - INFO - ==================================================
2025-03-25 23:56:07,416 - INFO - Epoch: 55/100. Training time: 96.933
2025-03-25 23:56:07,477 - INFO - Training Metrics...
2025-03-25 23:56:07,478 - INFO - {'loss': 0.45311595854305087, 'f1': 70.95040029725102, 'acc': 83.23066629752675, 'precision': 67.29378373184247, 'recall': 86.99621813601395, 'balanced acc': 86.99621813601395}
2025-03-25 23:56:07,478 - INFO - Validation Metrics... Inference time: 34.879
2025-03-25 23:56:07,478 - INFO - {'loss': 0.6581171154975891, 'f1': 75.12650078938034, 'acc': 81.03312191684284, 'precision': 72.18181935559797, 'recall': 87.4579191567591, 'balanced acc': 87.4579191567591}
2025-03-25 23:56:07,478 - INFO - ==================================================
2025-03-26 00:06:17,568 - INFO - Epoch: 60/100. Training time: 112.194
2025-03-26 00:06:17,617 - INFO - Training Metrics...
2025-03-26 00:06:17,618 - INFO - {'loss': 0.4159311084520249, 'f1': 72.49949028245129, 'acc': 84.76218161683278, 'precision': 68.3803521431592, 'recall': 87.49299503125049, 'balanced acc': 87.49299503125049}
2025-03-26 00:06:17,618 - INFO - Validation Metrics... Inference time: 30.949
2025-03-26 00:06:17,618 - INFO - {'loss': 0.6748530864715576, 'f1': 74.45066777034125, 'acc': 79.75158562367865, 'precision': 72.14767793607247, 'recall': 87.22115078355857, 'balanced acc': 87.22115078355857}
2025-03-26 00:06:17,618 - INFO - ==================================================
2025-03-26 00:15:45,096 - INFO - Epoch: 65/100. Training time: 69.066
2025-03-26 00:15:45,131 - INFO - Training Metrics...
2025-03-26 00:15:45,131 - INFO - {'loss': 0.4262964597770146, 'f1': 71.8257709281839, 'acc': 82.2767626430417, 'precision': 68.62292954467688, 'recall': 89.02851747866491, 'balanced acc': 89.02851747866491}
2025-03-26 00:15:45,131 - INFO - Validation Metrics... Inference time: 30.908
2025-03-26 00:15:45,131 - INFO - {'loss': 0.685477614402771, 'f1': 74.13029784937798, 'acc': 79.18798449612403, 'precision': 71.89140036573787, 'recall': 87.21212434378333, 'balanced acc': 87.21212434378333}
2025-03-26 00:15:45,131 - INFO - ==================================================
2025-03-26 00:26:02,951 - INFO - Epoch: 70/100. Training time: 102.289
2025-03-26 00:26:03,029 - INFO - Training Metrics...
2025-03-26 00:26:03,029 - INFO - {'loss': 0.4590867048218137, 'f1': 68.94515889555586, 'acc': 81.0906699889258, 'precision': 65.9721402314359, 'recall': 86.44484797528274, 'balanced acc': 86.44484797528274}
2025-03-26 00:26:03,029 - INFO - Validation Metrics... Inference time: 44.268
2025-03-26 00:26:03,029 - INFO - {'loss': 0.6602656841278076, 'f1': 74.76074801127119, 'acc': 80.31659619450319, 'precision': 72.1172021396495, 'recall': 87.36638218580168, 'balanced acc': 87.36638218580168}
2025-03-26 00:26:03,029 - INFO - ==================================================
2025-03-26 00:32:21,208 - INFO - Early stopping criterion met. Stopping training.
2025-03-26 00:32:28,870 - INFO - Initializing final Evaluations:

2025-03-26 00:32:37,840 - INFO - Final validation metrics:
{'f1': 75.2604410329463, 'acc': 81.28435517970402, 'precision': 72.27742256008166, 'recall': 87.40708653818787, 'balanced acc': 87.40708653818787}
2025-03-26 00:32:46,747 - INFO - Final test pixel-wise classification metrics:
{'f1': 20.327154104325462, 'acc': 68.50422832980972, 'precision': 17.12605708245243, 'recall': 25.0, 'balanced acc': 25.0}
